I was testing doing complex filters in DXL vs. the GUI filter wizard
It appears that the following is supported:
Filter myFilter = attribute "attributeName" <OPERATOR> "attributeValue"
where <OPERATOR> is one of ==, !=, <, <=, >, >, or >=
Problem:
In the GUI filter wizard. operators "includes" and "excludes" are also supported. How does one use these operators with DXL?
My workaround is to use the below in lieu of "includes". Is this the same?:
Filter myFilter = contains(attribute "attributeName", "attributeValue", false)
Would the "excludes" be the below (NOT contains)?:
! contains(attribute "attributeName", "attributeValue", false)
Although the filter strings look different, they appear to work the same at first glance. Comments?
Example to play with (substitute an attribute you actually have):
Module m = current
Filter myFilter = current
myFilter = contains(attribute "customerInclude", "GENERIC", false)
//myFilter = attribute "customerInclude" == "GENERIC"
set(myFilter)
print stringOf(m,myFilter)
SystemAdmin - Wed Feb 10 13:52:15 EST 2010 |
Re: Filters with DXL, includes/excludes not supported with attribute function? SystemAdmin - Wed Feb 10 17:48:28 EST 2010
Later I found:
includes(attribute "attributeName", "attributeValue")
and
excludes(attribute "attributeName", "attributeValue")
in a separate chapter called "Filtering on multi-valued attributes"
|
Re: Filters with DXL, includes/excludes not supported with attribute function? llandale - Mon Feb 15 18:24:09 EST 2010
Yes, 'contains' is for sub-string matching of string or text attributes: Does the description contain 'Requirement'. 'includes()/excludes()' are for enumeration matching of mutli-enumerated attributes: Does CleaningDays include 'Monday'. some form of 'is' is for scalar attributes, or single-enumerated ones: is 'Requirement' true or is 'Shipped Day' Monday?
|